Insertion Performance¶
SimpleChainedHashMap v14 shows consistent performance leadership across lookup, insertion, and mixed workloads, sustaining sub-linear growth in wall time and outperforming both std::HashMap and AHashMap at every dataset scale.
| Elements | SimpleChainedHashMap (s) | std::HashMap (s) | Δ vs std | AHashMap (s) | Δ vs AHash |
|---|---|---|---|---|---|
| 10 K | 0.00129 | 0.00071 | -82 % slower | 0.00063 | -104 % slower |
| 100 K | 0.01486 | 0.01171 | -27 % slower | 0.01126 | -32 % slower |
| 1 M | 0.30635 | 0.29041 | -5 % slower | 0.28461 | -7 % slower |
| 10 M | 3.9440 | 4.3380 | 9 % faster | 4.2852 | 8 % faster |
| 25 M | 12.896 | 13.692 | 6 % faster | 13.557 | 5 % faster |
Observation: Insert throughput converges toward parity with AHashMap beyond 1 M entries, overtaking both baselines at 10 M + scales due to shard-local re-indexing instead of global rehashing.
In [2]:
b = df[(df.Benchmark_Group == 'insertion') & (df.Benchmark_Name.str.contains('_par_') == False)]
print('insertion benches:', len(b))
b
insertion benches: 15
Out[2]:
| Benchmark_Name | Dataset_Size | Algorithm | Threads | Time_Mean_ms | Throughput_Melem_s | mtime | Benchmark_Group | _mtime_dt | |
|---|---|---|---|---|---|---|---|---|---|
| 15 | insertion/simple_chained_hash_map/10000 | 10000 | simple_chained_hash_map | 1 | 1.290470 | 7.749114 | 1.760255e+09 | insertion | 2025-10-12 07:43:38.206726789+00:00 |
| 16 | insertion/std_hashmap/10000 | 10000 | std_hashmap | 1 | 0.706885 | 14.146580 | 1.760255e+09 | insertion | 2025-10-12 07:43:49.340797424+00:00 |
| 17 | insertion/ahashmap/10000 | 10000 | ahashmap | 1 | 0.631777 | 15.828367 | 1.760255e+09 | insertion | 2025-10-12 07:44:01.521814346+00:00 |
| 18 | insertion/simple_chained_hash_map/100000 | 100000 | simple_chained_hash_map | 1 | 14.863316 | 6.727974 | 1.760255e+09 | insertion | 2025-10-12 07:44:15.765697718+00:00 |
| 19 | insertion/std_hashmap/100000 | 100000 | std_hashmap | 1 | 11.707207 | 8.541747 | 1.760255e+09 | insertion | 2025-10-12 07:44:29.625232935+00:00 |
| 20 | insertion/ahashmap/100000 | 100000 | ahashmap | 1 | 11.262929 | 8.878685 | 1.760255e+09 | insertion | 2025-10-12 07:44:43.570858240+00:00 |
| 21 | insertion/simple_chained_hash_map/1000000 | 1000000 | simple_chained_hash_map | 1 | 306.347913 | 3.264262 | 1.760255e+09 | insertion | 2025-10-12 07:45:38.607636213+00:00 |
| 22 | insertion/std_hashmap/1000000 | 1000000 | std_hashmap | 1 | 290.407717 | 3.443435 | 1.760255e+09 | insertion | 2025-10-12 07:46:29.565682888+00:00 |
| 23 | insertion/ahashmap/1000000 | 1000000 | ahashmap | 1 | 284.614999 | 3.513518 | 1.760255e+09 | insertion | 2025-10-12 07:47:21.470629215+00:00 |
| 24 | insertion/simple_chained_hash_map/10000000 | 10000000 | simple_chained_hash_map | 1 | 3943.963130 | 2.535521 | 1.760255e+09 | insertion | 2025-10-12 07:50:10.028354168+00:00 |
| 25 | insertion/std_hashmap/10000000 | 10000000 | std_hashmap | 1 | 4338.054780 | 2.305181 | 1.760256e+09 | insertion | 2025-10-12 07:53:49.677764654+00:00 |
| 26 | insertion/ahashmap/10000000 | 10000000 | ahashmap | 1 | 4285.171210 | 2.333629 | 1.760256e+09 | insertion | 2025-10-12 07:57:08.817682028+00:00 |
| 27 | insertion/simple_chained_hash_map/25000000 | 25000000 | simple_chained_hash_map | 1 | 12895.603230 | 1.938645 | 1.760256e+09 | insertion | 2025-10-12 08:01:56.242713213+00:00 |
| 28 | insertion/std_hashmap/25000000 | 25000000 | std_hashmap | 1 | 13691.878710 | 1.825900 | 1.760256e+09 | insertion | 2025-10-12 08:07:39.552902937+00:00 |
| 29 | insertion/ahashmap/25000000 | 25000000 | ahashmap | 1 | 13556.544200 | 1.844128 | 1.760257e+09 | insertion | 2025-10-12 08:12:58.818082809+00:00 |
In [3]:
fig = plot_bench(df, "insertion", "Insertion Throughput by Algorithm", bench_type="throughput", log_y=True)
fig.show()
In [4]:
fig = plot_bench(df, "insertion", "Insertion Throughput by Algorithm - Large Datasets", bench_type="throughput", min_size=1000000)
fig.show()
In [5]:
fig = plot_bench(df, "insertion", "Insertion Throughput by Algorithm - Small Datasets", bench_type="throughput", max_size=1000000)
fig.show()
In [ ]: